package edu.tongji.gridding.database;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import edu.tongji.gridding.utils.CommonUtils;

public abstract class BaseDao {
	public abstract Map<String, String> getIndexList(String keyword);
	
	public List<String> getIndexUrlFPs(String keyword) {
		return new ArrayList<String>(getIndexList(keyword).keySet());
	}
	
	public List<String> getSortedIndexUrlFPs(String keyword, int cnt) {
		List<String> sr = sortUrlFPs(getIndexUrlFPs(keyword));
		
		return CommonUtils.getSubList(sr, cnt);
	}
	
	protected List<String> sortUrlFPs(List<String> results) {
		return results;
	}
}
